<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      header {
        width: 375px;
        height: 60px;
        background-color: chocolate;
        text-align: center;
        line-height: 60px;
        color: #fff;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <h3>具名插槽</h3>
      <child>
        <!-- <button>btn</button>
        <span>+</span> -->

        <template #btn>
          <button>btn</button>
        </template>
        <template #add>
          <span>+</span>
        </template>

        <!-- default相当于没有加名字 -->
        <template v-slot:default>
          <a href="#">123</a>
        </template>
      </child>
    </div>

    <script src="../Vue.js"></script>
    <script>
      const Child = {
        template: `
          <header>
            <slot name="btn"></slot>
            猫眼电影
            <slot name="add"></slot>
            <slot></slot>
          </header>
        `,
      };
      new Vue({
        el: "#app",
        data: {},
        components: {
          Child,
        },
      });
    </script>
  </body>
</html>
